﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Engine.IA.PathFind;
using Engine.Behaviors.Behavior;
using Engine.IA.Atuadores;
using Engine.IA.Sensor;
using Engine.SceneControl;
using Microsoft.Xna.Framework.Graphics;

namespace Engine.IA.Steering
{
    public class Seek : ISteeringBehavior
    {
        #region ISteeringBehaviors Members

        private IObject obj;        
        
        public Seek(IObject obj)
        {
            this.obj = obj;            
        }

        
        public SteeringInfoOutput Perform(SteeringInfoInput input)
        {
            SteeringInfoOutput ou = new SteeringInfoOutput();                                              
            Vector3 p = input.Owner.Position + input.Owner.PhysicObject.FaceVector * 10;
            Vector3 target = input.Target.Position - p;
            target.Normalize();
            ou.Direction = target;
            return ou;
        }

        #endregion
    }
}
